from django.db import models

# Create your models here.
from django.contrib.auth.models import AbstractUser


class User(AbstractUser):
    mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号', null=True)
    maximum_borrowed = models.IntegerField(verbose_name='最大借阅数量', default=10)
    borrowed = models.IntegerField(verbose_name='借阅数量', default=0)

    class Meta:
        db_table = "users"
        verbose_name = '用户管理'
        verbose_name_plural = verbose_name
        ordering = ('id',)

    def __str__(self):
        return self.username

